home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_081 / icon / version6.doc < prev    next >
Text File  |  1992-05-06  |  29KB  |  993 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                           Version 6.0 of Icon*
  15.  
  16.  
  17.                             Ralph E. Griswold
  18.                            William H. Mitchell
  19.                              Janalee O'Bagy
  20.  
  21.  
  22.  
  23.                                 TR 86-10a
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.                               June 8, 1986
  50.  
  51.  
  52.                      Department of Computer Science
  53.  
  54.                         The University of Arizona
  55.  
  56.                           Tucson, Arizona 85721
  57.  
  58.  
  59.  
  60.  
  61.     *This work was supported by the National Science Foundation under
  62.     Grant DCR-8401831.
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.                            Version 6.0 of Icon
  77.  
  78.  
  79.  
  80.  
  81.     _1_.___B_a_c_k_g_r_o_u_n_d
  82.  
  83.        Different versions of the Icon programming language are iden-
  84.     tified by numbers. The first, Version 1, was superceded by Ver-
  85.     sion 2. Starting with Version 3, the implementation of Icon was
  86.     completely changed. While Version 2 is still in use on some com-
  87.     puters, Version 5 is by far the mostly widely used version of
  88.     Icon.  The features of Version 5 are described in the ``Icon
  89.     book'' [1].  Since this book is the only complete and generally
  90.     available description of a widely used version of Icon, Version 5
  91.     is sometimes called ``standard Icon''.
  92.  
  93.        Since Icon is the byproduct of a research effort that is con-
  94.     cerned with the development of novel programming language
  95.     features, some extensions to the standard language are inevit-
  96.     able.  These extensions are incorporated as features of new
  97.     releases of the implementation.  These releases are identified by
  98.     minor version numbers that are separated from the major version
  99.     number by a decimal point. For example, Version 5.10 is the tenth
  100.     minor revision of Version 5.
  101.  
  102.        Because of the relationship between language design and imple-
  103.     mentation, major version numbers usually contain significant
  104.     language changes that have accumulated over a number of minor
  105.     revisions, while minor version numbers primarily reflect imple-
  106.     mentation changes.
  107.  
  108.        Recently an implementation of Icon written almost entirely in
  109.     C has been completed. This implementation is so different from
  110.     previous ones that some designation is needed to distinguish it
  111.     from other implementations. It therefore has been designated Ver-
  112.     sion 6.  Despite the change in major version number, the Version
  113.     6.0 language is nearly the same as the Version 5.10 language and
  114.     the Version 5 book continues to serve as the primary reference
  115.     for Version 6.  Since a revision of a book is a major and time-
  116.     consuming process, this report is provided to supplement the
  117.     present Icon book.  Together, the book and this report provide a
  118.     description of Version 6.0.
  119.  
  120.        Most of the language extensions in Version 6.0 are upward-
  121.     compatible with Version 5 and almost all programs that contain
  122.     only standard Version 5 features work properly under Version 6.0.
  123.     However, some of the more implementation-dependent aspects
  124.     described in the Version 5 book are now obsolete and there are
  125.     significant new language features.
  126.  
  127.  
  128.  
  129.  
  130.                                  - 1 -
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.     _2_.___F_e_a_t_u_r_e_s__o_f__V_e_r_s_i_o_n__6_._0
  140.  
  141.        Version 6.0 extensions consist of a declaration to facilitate
  142.     the use of Icon procedure libraries, a new set data type, new
  143.     options for sorting tables, new syntax to support the use of co-
  144.     expressions in programmer-defined control operations, the invoca-
  145.     tion of functions and operators by their string names, and a few
  146.     new functions.
  147.  
  148.     _2_._1___T_h_e__L_i_n_k__D_e_c_l_a_r_a_t_i_o_n
  149.  
  150.        The link declaration simplifies the inclusion of separately
  151.     translated libraries of Icon procedures. If icont [2] is run with
  152.     the -c option, source files are translated into intermediate
  153.     _u_c_o_d_e files (with names ending in .u1 and .u2).  For example,
  154.  
  155.             icont -c libe.icn
  156.  
  157.     produces the ucode files libe.u1 and libe.u2. The ucode files can
  158.     be incorporated in another program with the new link declaration,
  159.     which has the form
  160.  
  161.             link libe
  162.  
  163.     The argument of link is, in general, a list of identifiers or
  164.     string literals that specify the names of files to be linked
  165.     (without the .u1 or .u2). Thus, when running under UNIX*,
  166.  
  167.             link libe, "/usr/icon/ilib/collate"
  168.  
  169.     specifies the linking of libe in the current directory and col-
  170.     late in /usr/icon/ilib.  The syntax for paths may be different
  171.     for other operating systems.
  172.  
  173.        The environment variable IPATH controls the location of files
  174.     specified in link declaratinos. The value of IPATH should be a
  175.     blank-separated string1 of the form _p_1 _p_2  ... _p_n where each _p_i
  176.     names a directory.  Each directory is searched in turn to locate
  177.     files named in link declarations. The default value of IPATH is
  178.     the current directory.
  179.  
  180.     _2_._2___S_e_t_s
  181.  
  182.        Sets are unordered collections of values and have many of the
  183.     properties normally associated with sets in the mathematical
  184.     sense.  The function
  185.  
  186.             set(a)
  187.  
  188.     __________________________
  189.     *UNIX is a trademark of AT&T Bell Laboratories.
  190.     1The separator is a colon for UNIX  systems  under  Versions
  191.     5.9 and 5.10.
  192.  
  193.  
  194.  
  195.  
  196.                                  - 2 -
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.     creates a set that contains the distinct elements of the list a.
  206.     For example,
  207.  
  208.             set(["abc",3])
  209.  
  210.     creates a set with two members, abc and 3.  Note that
  211.  
  212.             set([])
  213.  
  214.     creates an empty set.  Sets, like other data aggregates in Icon,
  215.     need not be homogeneous - a set may contain members of different
  216.     types.
  217.  
  218.        Sets, like other Icon data aggregates, are represented by
  219.     pointers to the actual data. Sets can be members of sets, as in
  220.  
  221.             s1 := set([1,2,3])
  222.             s2 := set([s1,[]])
  223.  
  224.     in which s2 contains two members, one of which is a set of three
  225.     members and the other of which is an empty list.
  226.  
  227.        Any specific value can occur only once in a set. For example,
  228.  
  229.             set([1,2,3,3,1])
  230.  
  231.     creates a set with the three members 1, 2, and 3.  Set membership
  232.     is determined the same way the equivalence of values is deter-
  233.     mined in the operation
  234.  
  235.             x === y
  236.  
  237.     For example,
  238.  
  239.             set([[],[]])
  240.  
  241.     creates a set that contains two distinct empty lists.
  242.  
  243.        Several set operations are provided. The function
  244.  
  245.             member(s,x)
  246.  
  247.     succeeds and returns the value of x if x is a member of s, but
  248.     fails otherwise. Note that
  249.  
  250.             member(s1,member(s2,x))
  251.  
  252.     succeeds if x is a member of both s1 and s2.
  253.  
  254.        The function
  255.  
  256.             insert(s,x)
  257.  
  258.     inserts x into the set s and returns the value of s.  Note that
  259.  
  260.  
  261.  
  262.                                  - 3 -
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.     insert(s,x) is similar to put(a,x) in form.  A set may contain (a
  272.     pointer to) itself:
  273.  
  274.             insert(s,s)
  275.  
  276.     adds s as an member of itself.
  277.  
  278.        The function
  279.  
  280.             delete(s,x)
  281.  
  282.     deletes the member x from the set s and returns the value of s.
  283.  
  284.        The functions insert(s,x) and delete(s,x) always succeed,
  285.     whether or not x is in s. This allows their use in loops in which
  286.     failure may occur for other reasons. For example,
  287.  
  288.             s := set([])
  289.             while insert(s,read())
  290.  
  291.     builds a set that consists of the (distinct) lines from the stan-
  292.     dard input file.
  293.  
  294.        The operations
  295.  
  296.             s1 ++ s2
  297.             s1 ** s2
  298.             s1 -- s2
  299.  
  300.     create the union, intersection, and difference of s1 and s2,
  301.     respectively. In each case, the result is a new set.
  302.  
  303.        The use of these operations on csets is unchanged. There is no
  304.     automatic type conversion between csets and sets; the result of
  305.     the operation depends on the types of the arguments. For example,
  306.  
  307.             'aeiou' ++ 'abcde'
  308.  
  309.     produces the cset 'abcdeiou', while
  310.  
  311.             set([1,2,3]) ++ set([2,3,4])
  312.  
  313.     produces a set that contains 1, 2, 3, and 4. On the other hand,
  314.  
  315.             set([1,2,3]) ++ 4
  316.  
  317.     results in Run-time Error 119 (set expected).
  318.  
  319.        The functions and operations of Icon that apply to other data
  320.     aggregates apply to sets as well. For example, if s is a set,
  321.  
  322.             *s
  323.  
  324.     is the size of s (the number of members in it). Similarly,
  325.  
  326.  
  327.  
  328.                                  - 4 -
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.             type(s)
  338.  
  339.     produces the string set.  The string images of sets are in the
  340.     same style as for other aggregates, with the size enclosed in
  341.     parentheses. Therefore,
  342.  
  343.             s := set(["abc",3])
  344.             write(image(s))
  345.  
  346.     writes set(2).
  347.  
  348.        The operation
  349.  
  350.             !s
  351.  
  352.     generates the members of s, but in no predictable order. Simi-
  353.     larly,
  354.  
  355.             ?s
  356.  
  357.     produces a randomly selected member of s.  These operations pro-
  358.     duce values, not variables - it is not possible to assign a value
  359.     to !s or ?s.
  360.  
  361.        The function
  362.  
  363.             copy(s)
  364.  
  365.     produces a new set, distinct from s, but which contains the same
  366.     members as s. The copy is made in the same fashion as the copy of
  367.     a list - the members themselves are not copied.
  368.  
  369.        The function
  370.  
  371.             sort(s)
  372.  
  373.     produces a list containing the members of s in sorted order.
  374.     Sets occur after tables but before records in Icon's collating
  375.     sequence.
  376.  
  377.     _E_x_a_m_p_l_e_s
  378.  
  379.     _W_o_r_d _C_o_u_n_t_i_n_g:
  380.  
  381.        The following program lists, in alphabetical order, all the
  382.     different words that occur in standard input:
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.                                  - 5 -
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.             procedure main()
  404.                letter := &lcase ++ &ucase
  405.                words := set([])
  406.                while text := read() do
  407.                   text ? while tab(upto(letter)) do
  408.                      insert(words,tab(many(letter)))
  409.                every write(!sort(words))
  410.             end
  411.  
  412.  
  413.     _T_h_e _S_i_e_v_e _o_f _E_r_a_t_o_s_t_h_e_n_e_s:
  414.  
  415.        The follow program produces prime numbers, using the classical
  416.     ``Sieve of Eratosthenes'':
  417.  
  418.             procedure main()
  419.                local limit, s, i
  420.                limit := 5000
  421.                s := set([])
  422.                every insert(s,1 to limit)
  423.                every member(s,i := 2 to limit) do
  424.                   every delete(s,i + i to limit by i)
  425.                primes := sort(s)
  426.                write("There are ",*primes," primes in the first ",limit," integers.")
  427.                write("The primes are:")
  428.                every write(right(!primes,*limit + 1))
  429.             end
  430.  
  431.  
  432.     _2_._3___S_o_r_t_i_n_g__T_a_b_l_e_s
  433.  
  434.        Two new options are available for sorting tables. These
  435.     options are specified by the values 3 and 4 as the second argu-
  436.     ment of sort(t,i).  Both of these options produce a single list
  437.     in which the entry values and assigned values of table elements
  438.     alternate. A value of 3 for i produces a list in which the entry
  439.     values are in sorted order, and a value of 4 produces a list in
  440.     which the assigned values are in sorted order. For example, if
  441.     the table wcount contains elements whose entry values are words
  442.     and whose corresponding assigned values are counts, the following
  443.     code segment writes out a list of the words and their counts,
  444.     with the words in alphabetical order:
  445.  
  446.             a := sort(wcount,3)
  447.             every i := 1 to *a - 1 by 2 do
  448.                write(a[i]," : ",a[i + 1])
  449.  
  450.  
  451.        The main advantage of the new sorting options is that they
  452.     only produce a single list, rather than a list of lists as pro-
  453.     duced by the options 1 and 2. The amount of space needed for the
  454.     single list is proportionally much less than for the list of
  455.     lists.
  456.  
  457.  
  458.  
  459.  
  460.                                  - 6 -
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.     _2_._4___P_r_o_g_r_a_m_m_e_r_-_D_e_f_i_n_e_d__C_o_n_t_r_o_l__O_p_e_r_a_t_i_o_n_s
  470.  
  471.        As described in [3], co-expressions can be used to provide
  472.     programmer-defined control operations. Version 6.0 provides sup-
  473.     port for this facility by means of an alternative syntax for pro-
  474.     cedure invocation in which the arguments are passed in a list of
  475.     co-expressions. This syntax uses braces in place of parentheses:
  476.  
  477.             p{_e_x_p_r_1, _e_x_p_r_2, ..., _e_x_p_r_n}
  478.  
  479.     is equivalent to
  480.  
  481.             p([create _e_x_p_r_1, create _e_x_p_r_2, ..., create _e_x_p_r_n])
  482.  
  483.     Note that
  484.  
  485.             p{}
  486.  
  487.     is equivalent to
  488.  
  489.             p([])
  490.  
  491.  
  492.     _2_._5___I_n_v_o_c_a_t_i_o_n__B_y__S_t_r_i_n_g__N_a_m_e
  493.  
  494.        A string-valued expression that corresponds to the name of a
  495.     procedure or operation can be used in place of the procedure or
  496.     operation in an invocation expression. For example,
  497.  
  498.             "image"(x)
  499.  
  500.     produces the same call as
  501.  
  502.             image(x)
  503.  
  504.     and
  505.  
  506.             "-"(i,j)
  507.  
  508.     is equivalent to
  509.  
  510.             i - j
  511.  
  512.  
  513.        In the case of operator symbols with unary and binary forms,
  514.     the number of arguments determines the operation. Thus
  515.  
  516.             "-"(i)
  517.  
  518.     is equivalent to
  519.  
  520.             -i
  521.  
  522.     Since to-by is an operation, despite its reserved-word syntax, it
  523.  
  524.  
  525.  
  526.                                  - 7 -
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.     is included in this facility with the string name "..." .  Thus
  536.  
  537.             "..."(1,10,2)
  538.  
  539.     is equivalent to
  540.  
  541.             1 to 10 by 2
  542.  
  543.     Similarly, range specifications are represented by ":", so that
  544.  
  545.             ":"(s,i,j)
  546.  
  547.     is equivalent to
  548.  
  549.             s[i:j]
  550.  
  551.  
  552.        Defaults are not provided for omitted or null-valued arguments
  553.     in this facility. Consequently,
  554.  
  555.             "..."(1,10)
  556.  
  557.     results in a run-time error when it is evaluated.
  558.  
  559.        The subscripting operation is available with the string name
  560.     "[]". Thus
  561.  
  562.             "[]"(&lcase,3)
  563.  
  564.     produces c.
  565.  
  566.        Arguments to operators invoked by string names are derefer-
  567.     enced. Consequently, string invocation for assignment operations
  568.     is ineffective and results in error termination.
  569.  
  570.        String names are available for the operations in Icon, but not
  571.     for control structures. Thus
  572.  
  573.             "|"(_e_x_p_r_1,_e_x_p_r_2)
  574.  
  575.     is erroneous.  Note that string scanning is a control structure.
  576.  
  577.        Field references, of the form
  578.  
  579.             _e_x_p_r . _f_i_e_l_d_n_a_m_e
  580.  
  581.     are not operations in the ordinary sense and are not available
  582.     via string invocation.  In addition, conjunction is not available
  583.     via string invocation, since no operation is actually performed.
  584.  
  585.        String names for procedures are available through global iden-
  586.     tifiers.  Note that the names of functions, such as image, are
  587.     global identifiers. Similarly, any procedure-valued global iden-
  588.     tifier may be used as the string name of a procedure. Thus in
  589.  
  590.  
  591.  
  592.                                  - 8 -
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.             global q
  602.  
  603.             procedure main()
  604.                q := p
  605.                "q"("hi")
  606.             end
  607.  
  608.             procedure p(s)
  609.                write(s)
  610.             end
  611.  
  612.     the procedure p is invoked via the global identifier q.
  613.  
  614.     _2_._6___N_e_w__F_u_n_c_t_i_o_n_s
  615.  
  616.        The function proc(x,i) converts x to a procedure, if possible.
  617.     If x is procedure-valued, its value is returned unchanged. If the
  618.     value of x is a string that corresponds to the name of a pro-
  619.     cedure as described in the preceding section, the corresponding
  620.     procedure value is returned.  The value of i is used to distin-
  621.     guish between unary and binary operators.  For example,
  622.     proc("*",2) produces the multiplication operator, while
  623.     proc("*",1) produces the size operator.  The default value for i
  624.     is 1.  If x cannot be converted to a procedure, proc(x,i) fails.
  625.  
  626.        The function seq(i,j) generates an infinite sequence of
  627.     integers starting at i with increments of j. An omitted or null-
  628.     valued argument defaults to 1. For example, seq() generates 1, 2,
  629.     3, ... .
  630.  
  631.        Storage is allocated automatically during the execution of an
  632.     Icon program, and garbage collections are performed automatically
  633.     to reclaim storage for subsequent reallocation. Garbage collec-
  634.     tion normally only occurs when it is necessary. Garbage collec-
  635.     tion can be forced by the function collect().
  636.  
  637.     _2_._7___M_i_n_o_r__L_a_n_g_u_a_g_e__C_h_a_n_g_e_s
  638.  
  639.        There are two minor language changes:
  640.  
  641.          o+   The keyword &options of Version 5.10 is not present in
  642.              Version 6.0.
  643.  
  644.          o+   Version 6.0 reads the last line of a file, even if that
  645.              line does not end with a newline; Version 5 discards
  646.              such a line.
  647.  
  648.     _2_._8___V_e_r_s_i_o_n__C_h_e_c_k_i_n_g
  649.  
  650.        The Icon translator converts a source-language program to an
  651.     intermediate form, called _u_c_o_d_e. The Icon linker converts one or
  652.     more ucode files to a binary form called _i_c_o_d_e. The format of
  653.     Version 6.0 ucode and icode files is different from that of ear-
  654.     lier versions.  To avoid the possibility of malfunction due to
  655.  
  656.  
  657.  
  658.                                  - 9 -
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.     incompatible ucode and icode formats, Version 6.0 checks both
  668.     ucode and icode files and terminates processing with an error
  669.     message if the versions are not correct.
  670.  
  671.  
  672.     _3_.___O_b_s_o_l_e_t_e__a_n_d__C_h_a_n_g_e_d__F_e_a_t_u_r_e_s__o_f__V_e_r_s_i_o_n__5
  673.  
  674.        The original implementation of Version 5 supported both a com-
  675.     piler (iconc) and an interpreter (icont).  Version 6.0 supports
  676.     only an interpreter. Interpretation is only slightly slower than
  677.     the execution of compiled code and the interpreter is portable
  678.     and gets into execution much more quickly than the compiler. How-
  679.     ever, it is not possible to load C functions with the interpreter
  680.     as it was with the compiler.  A system for personalized inter-
  681.     preters [4] is included with Version 6.0 for UNIX systems to make
  682.     it comparatively easy to add new functions and otherwise modify
  683.     the Icon run-time system.
  684.  
  685.        Some run-time environment variables have changed; see Appendix
  686.     A.  A number of error messages have been changed.  Appendix B
  687.     contains a list of run-time error messages.
  688.  
  689.  
  690.  
  691.     _4_.___K_n_o_w_n__B_u_g_s__i_n__V_e_r_s_i_o_n__6_._0
  692.  
  693.  
  694.          o+  The translator does not detect arithmetic overflow in
  695.             conversion of numeric literals. Very large numeric
  696.             literals may have incorrect values.
  697.  
  698.          o+  Integer overflow on multiplication and exponentiation is
  699.             not detected during execution.  Such overflow may occur
  700.             during type conversion.
  701.  
  702.          o+  Line numbers may be wrong in diagnostic messages related
  703.             to lines with continued quoted literals.
  704.  
  705.          o+  In some cases, trace messages may show the return of sub-
  706.             scripted values, such as &null[2], that would be errone-
  707.             ous if they were dereferenced.
  708.  
  709.          o+  If a long file name for an Icon source-language program
  710.             is truncated by the operating system, mysterious diagnos-
  711.             tic messages may occur during linking.
  712.  
  713.          o+  Stack overflow is checked using a heuristic that may not
  714.             always be effective.
  715.  
  716.          o+  If an expression such as
  717.  
  718.                     x := create _e_x_p_r
  719.  
  720.             is used in a loop, and x is not a global variable,
  721.             unreferenceable co-expressions are generated by each suc-
  722.             cessive create operation.  These co-expressions are not
  723.  
  724.  
  725.  
  726.                                  - 10 -
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.             garbage collected.  This problem can be circumvented by
  736.             making x a global variable or by assigning a value to x
  737.             before the create operation, as in
  738.  
  739.                     x := &null
  740.                     x := create _e_x_p_r
  741.  
  742.  
  743.          o+  Stack overflow in a co-expression may not be detected and
  744.             may cause mysterious program malfunction.
  745.  
  746.          o+  Co-expressions were designed to support coroutine pro-
  747.             gramming as well as the more usual application for the
  748.             controlled production of the results of a generator.
  749.             However, the implementation is not sufficiently general
  750.             to support coroutines. In Version 5, the use of co-
  751.             expressions in a coroutine fashion could produce program
  752.             malfunction. In Version 6.0, such uses are prevented and
  753.             cause error termination. As a consequence, some uses of
  754.             co-expressions that worked in Version 5 may not work in
  755.             Version 6.0. In particular, the example in Section 13.4.2
  756.             of the Icon book does not work in Version 6.0.
  757.  
  758.          o+  The garbage collector was designed for machines with com-
  759.             paratively small address spaces and may not perform well
  760.             for computers with very large address spaces.  In partic-
  761.             ular, if an attempt is made to create a very large data
  762.             object that will not fit into memory (such as a million-
  763.             element list), it takes an inordinately long time to
  764.             determine that the object can not be allocated.
  765.  
  766.  
  767.     _5_.___P_o_s_s_i_b_l_e__D_i_f_f_e_r_e_n_c_e_s__A_m_o_n_g__V_e_r_s_i_o_n__6_._0__I_m_p_l_e_m_e_n_t_a_t_i_o_n_s
  768.  
  769.        Version 6.0 of Icon is written almost entirely in C and most
  770.     of its features are machine-independent. Appendix B of the Icon
  771.     book lists differences that may occur because of different
  772.     machine architectures.  In addition to the differences listed
  773.     there, the implementation of sets and tables uses a parameter
  774.     that is different for 16- and 32-bit computers. This parameter
  775.     determines how set members and table elements are physically
  776.     stored as a result of hashing. The difference only is noticeable
  777.     in the results produced by !x and ?x, where x is a set or a
  778.     table.
  779.  
  780.        A few aspects of the implementation of Version 6.0 are
  781.     specific to different computer architectures and operating sys-
  782.     tems. Co-expressions require a context switch that is implemented
  783.     in assembly language.  If this context switch is not implemented,
  784.     an attempt to activate a co-expression results in error termina-
  785.     tion.  Arithmetic overflow checking also generally requires
  786.     assembly-language routines and may not be supported on some
  787.     implementations of Version 6.0.
  788.  
  789.  
  790.  
  791.  
  792.                                  - 11 -
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.        Some features of Icon, such as opening a pipe for i/o and the
  802.     system function, are closely related to UNIX. These features
  803.     should work correctly for Version 6.0 running on UNIX systems,
  804.     but they may not be supported on other operating systems.
  805.  
  806.     _A_c_k_n_o_w_l_e_d_g_e_m_e_n_t_s
  807.  
  808.        In addition to the authors of this report, several persons
  809.     contributed to the implementation of Version 6.0 of Icon.  The
  810.     implementation of sets and the new sorting options were done by
  811.     Rob McConeghy.  Other major contributors include Gregg Townsend,
  812.     Chris Janton, and Kelvin Nilsen.
  813.  
  814.     _R_e_f_e_r_e_n_c_e_s
  815.  
  816.     1.  Griswold, Ralph E. and Madge T. Griswold. _T_h_e _I_c_o_n _P_r_o_g_r_a_m_-
  817.     _m_i_n_g _L_a_n_g_u_a_g_e, Prentice-Hall, Inc., Englewood Cliffs, New Jersey.
  818.     1983.
  819.  
  820.     2.  Griswold, Ralph E. _I_C_O_N_T(_1), manual page for _U_N_I_X
  821.     _P_r_o_g_r_a_m_m_e_r'_s _M_a_n_u_a_l, Department of Computer Science, The Univer-
  822.     sity of Arizona. May 1986.
  823.  
  824.     3.  Griswold, Ralph E. and Michael Novak. ``Programmer-Defined
  825.     Control Operations'', _T_h_e _C_o_m_p_u_t_e_r _J_o_u_r_n_a_l, Vol. 26, No. 2 (May
  826.     1983).
  827.  
  828.     4.  Griswold, Ralph E. _P_e_r_s_o_n_a_l_i_z_e_d _I_n_t_e_r_p_r_e_t_e_r_s _f_o_r _V_e_r_s_i_o_n _6._0
  829.     _o_f _I_c_o_n, Technical Report TR 86-12, Department of Computer Sci-
  830.     ence, The University of Arizona. May 1985.
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.                                  - 12 -
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.                    Appendix A - Environment Variables
  868.  
  869.  
  870.  
  871.  
  872.        There are a number of environment variables that can be set to
  873.     override the default values for sizes of Icon's storage regions
  874.     and other run-time parameters. These environment variables are:
  875.  
  876.          TRACE     The initial value of &trace. The default value is
  877.                    zero.
  878.  
  879.          NBUFS     The number of input-output buffers.  The default
  880.                    value is 10 for computers with large address
  881.                    spaces and 5 for computers with small address
  882.                    spaces.
  883.  
  884.          NOERRBUF  No buffering of standard error output.
  885.  
  886.          ICONCORE  Produce a core dump in the case of error termina-
  887.                    tion.
  888.  
  889.          MSTKSIZE  The size in words of the main interpreter stack.
  890.                    The default value is 10000 for machines with large
  891.                    address spaces and 3000 for machines with small
  892.                    address spaces.
  893.  
  894.          STRSIZE   The initial size in bytes of the allocated string
  895.                    region. The default value is 51200 for machines
  896.                    with large address spaces and 10240 for machines
  897.                    with small address spaces.
  898.  
  899.          HEAPSIZE  The initial size in bytes of the allocated block
  900.                    region. The default value is 51200 for machines
  901.                    with large address spaces and 10240 for machines
  902.                    with small address spaces.
  903.  
  904.          STATSIZE  The initial size in bytes of the static region in
  905.                    which co-expressions are allocated. The default
  906.                    value is 20480 for machines with large address
  907.                    spaces and 1024 for machines with small address
  908.                    spaces.
  909.  
  910.          STATINCR  The increment for expanding the static region. The
  911.                    default increment is one-fourth the initial size
  912.                    of the static region.
  913.  
  914.          COEXPSIZE The size in words of co-expression blocks. The
  915.                    default value is 2000 for machines with large
  916.                    address spaces and 1000 for machines with small
  917.                    address spaces.
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.                                  - 13 -
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.                        Appendix B - Run-Time Error Messages
  934.  
  935.  
  936.  
  937.  
  938.  
  939.                       101     integer expected
  940.                       102     numeric expected
  941.                       103     string expected
  942.                       104     cset expected
  943.                       105     file expected
  944.                       106     procedure or integer expected
  945.                       107     record expected
  946.                       108     list expected
  947.                       109     string or file expected
  948.                       110     string or list expected
  949.                       111     variable expected
  950.                       112     invalid type to size operation
  951.                       113     invalid type to random operation
  952.                       114     invalid type to subscript operation
  953.                       115     list or table expected
  954.                       116     invalid type to element generator
  955.                       117     missing main procedure
  956.                       118     co-expression expected
  957.                       119     set expected
  958.  
  959.                       201     division by zero
  960.                       202     remaindering by zero
  961.                       203     integer overflow
  962.                       204     real overflow underflow or division by zero
  963.                       205     value out of range
  964.                       206     negative first operand to real exponentiation
  965.                       207     invalid field name
  966.                       208     second and third arguments to map of unequal length
  967.                       209     invalid second argument to open
  968.                       210     argument to system function too long
  969.                       211     by clause equal to zero
  970.                       212     attempt to read file not open for reading
  971.                       213     attempt to write file not open for writing
  972.                       214     recursive co-expression activation
  973.  
  974.                       301     interpreter stack overflow
  975.                       302     C stack overflow
  976.                       303     unable to expand memory region
  977.                       304     memory region size changed
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.                                  - 14 -
  991.  
  992.  
  993.